package instructor.sample;
import java.io.*;
import java.text.NumberFormat;
import java.util.Locale;
public class ShipCalculator{
	int quantity;
	int itemweight;
	float rate;
	float charge;
	
	public int getQuantity() {
		return quantity;
	}
	public void setQuantity(int quantity) {
		this.quantity = quantity;
	}
	public int getItemweight() {
		return itemweight;
	}
	public void setItemweight(int itemweight) {
		this.itemweight = itemweight;
	}
	public float getRate() {
		return rate;
	}
	public void setRate(float rate) {
		this.rate = rate;
	}
	public float getCharge() {
		return charge;
	}
	public void setCharge(float charge) {
		this.charge = charge;
	}

	public String getOutput() {
		NumberFormat nf = null;       // NumberFormat is an object in the java.util package.
		float shippingcharge = 0;
		nf = NumberFormat.getCurrencyInstance(Locale.US);
		shippingcharge = Math.round(((quantity * itemweight * rate)  + charge)* 100 )/100f;
		return nf.format(shippingcharge);
		}


}
